package models;

import play.*;
import play.db.jpa.*;

import javax.persistence.*;
import java.util.*;

@Entity
public class Reward extends Model{
	
	@ManyToOne
	public Developer applicationId;
	
	
	@ManyToOne
	public Point pointType;
	
	public int pointValue;
	
	@ManyToOne
	public Badge badgeType;
	
	public void execute(){

		pointType.defaultValue 	+= pointValue;
		pointType.save();
		badgeType.execute();
		badgeType.save();
	}
}

